#ifndef VISUALOBSERVATIONDIALOG_H
#define VISUALOBSERVATIONDIALOG_H

#include "ui_VisualObservationDialog.h"
#include "dogz/Dogz.h"
#include <QDateTime>
#include <QDialog>
#include <QNetworkAccessManager>
#include <QString>

class VisualObservationDialog : public QDialog
{
    Q_OBJECT

public:
    VisualObservationDialog(QNetworkAccessManager* mgr, QWidget *parent = 0);
    ~VisualObservationDialog() {}

private:
    Ui::VisualObservationDialogClass ui;

    /**
     * Zarządzanie gwiazdami.
     */
    Dogz::StarManager* starManager;

    /**
     * Poprzednia wartość pola nazwy gwiazdy.
     */
    QString previousStarName;

    bool hasValidObservation();

private slots:
    void on_editStarName_editingFinished();
    void on_btnDateTimeNow_clicked();
    void on_editDateTime_dateTimeChanged(const QDateTime& date);
    void on_btnAddObservation_clicked();

    void updateUi();

    void showStarInfo(Dogz::Star star);
};

#endif // VISUALOBSERVATIONDIALOG_H
